$(document).ready(function(){
	var validator = $("#frmChangeUsername").validate({
		errorElement:'div',
		rules: {
			username: {
				required: true,
				character:true,
				maxlength: 50,
				minlength:5,
				remote:SITEROOT+'/admin/settings/checkusernameexist.php'
			
			},
			password: {
				required: true
			}
		},
		messages: {
			username: {
				required: "Enter your username",
				character: "Please enter characters only",
				maxlength: jQuery.format("Enter at most {0} characters"),
				minlength: jQuery.format("Enter at most {0} characters"),
				remote: jQuery.format("Username already in use")
				
			},	
			password: {
				required: "Enter your current password"
			}
		}
	});
});